<?php
require_once '../../vendor/autoload.php';
class EventDemo
{
    use \Harvey\Toolsbox\traits\Event;
    public function __construct()
    {
        $this->on('test', [$this, 'test']);
        $this->on('test2', [$this, 'test2']);
    }

    public function index()
    {
        $this->trigger('test', 1);
        $this->trigger('test2', 1, 2);
    }

    private function test($a)
    {
        echo 'test_' . $a;
    }

    private function test2($a, $b)
    {
        var_dump('test_' . $a . '_' . $b); ;
    }
}

(new EventDemo())->index();